import Vue from 'vue'
import Router from 'vue-router'
import LoginTest from '@/components/LoginTest'
import Partition from '@/components/Partition'

Vue.use(Router)

//实例化VueRouter
const router=new VueRouter({
    mode:'history',
    routes:[
      {
        path:'/hello',
        components:{
          'hello':Hello
        }
      },
     //主站的路由跳转
     {
       path:'/main',
       components:{
         default:SearchBox,
         'recommend':Recommend,
         'columnPartition':ColumnPartition,
         'ccarousel':cCarousel,
         'partitionJava':Partition,
         'partitionC':Partition,
         'partitionPython':Partition,
         'partitionSpring':Partition,
         'partitionAndroid':Partition
       }
     },
     //登录&注册的路由跳转
     {
       path:'/loginRegister',
       components:{
         default:LoginTest,
       }
     },
     //登陆后用户个人中心
     {
       path:'/selfCenter',
       components:{
         default:SearchBox,
         'selfCenter':SelfCenter
       }
     },
     //上传资源页面的路由
     {
       path:'/FileUpload',
       components:{
         // default:SearchBox,
         'FileUpload':FileUpload
       }
     },
     //专栏推荐组件的路由
     {
       path:'/columnPartition',
       components:{
         // default:SearchBox,
         'columnPartition':ColumnPartition
       }
     },
     //上传资源页面的路由
     {
       path:'/columnContribution',
       components:{
         // default:SearchBox,
         'columnContribution':ColumnContribution
       }
     },
     //上传资源页面的路由
     {
       path:'/readColumn/:id',
       name:'readColumn',
       components:{
         // default:SearchBox,
         'readColumn':ReadColumn
       }
     },
     {
       path:'/videoview',
       components:{
         default:SearchBox,
         'videoview':VideoView
       }
     },
     //后台管理部分--login页面
     {
       path:'/adminViewLogin',
       components:{
         // default:SearchBox,
         default:AdminLogin,
         // 'adminLogin':AdminLogin
       }
     },
     //后台管理部分--管理员管理页面
     {
       path:'/managementPage',
       components:{
         // default:SearchBox,
         default:ManagementPage,
       }
     },
     //搜索后的结果将显示在这个页面
     {
       path:'/searchResult',
       components:{
         default:SearchBox,
         'searchResult':SearchResult
       }
     },
   ],
 
 })


 //挂载路由


// axios 配置

axios.defaults.timeout = 5000;

//axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';

axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8';

// axios.defaults.headers.post['Content-Type'] = 'json';

// axios.defaults.baseURL = 'http://localhost:8080/项目名/';

axios.defaults.baseURL = 'http://localhost:8080/';


Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})